<?php
namespace app\index\controller;
// namespace app\zw_admin\controller;
use \think\Controller;
use think\Db;
// use think\Controller;
use think\Session;
use think\Request;


class HouseController extends Controller
{
    public function index()
    {
		$homeList = Db::name('home')
        ->alias('a')
        ->join('drm_account b','b.uid = a.uid')
        ->order('time desc')
        ->select();
        // dump($homeList);
        // exit;
        $homeListTo = [];
        foreach ($homeList as $key => $value) {
            $homeListTo[$key] = $value;
            $imgList = explode(",",$value['home_images']);
            // dump($imgList);
            // exit;
            $homeListTo[$key]['home_img'] = $imgList[0];
        }
        // dump($homeListTo);
        // exit;
        $this->assign('homeList',$homeListTo);
		return $this->fetch('index');
    }


    public function ifempty()
    {
    	$uid = Session::get('member_id');
        // $sid = Session::get('seller_id');
        // echo $sid;
        // exit;
        // dump($_SESSION);
        // exit;
        if (empty($uid)) {
            return  'empty';
        }
    }
}
